<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
<base href="<%=basePath%>"/>

<title>soda教育</title>
<link href="qiantai/css/style.css" type="text/css" rel="stylesheet" />
<link href="qiantai/css/single.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="qiantai/js/banner1.js" ></script>
<script type="text/javascript" src="qiantai/js/banner3.js" ></script>
<script type="text/javascript">

var xmlhttp;
function ckuname() {
	
	var uname = document.getElementById("uname").value;
	var reg = /^[a-zA-Z]\w{5,9}$/;
	if (!reg.test(uname)) {
		document.getElementById("spuname").innerHTML = "以大小写字母开头，长度6位以上字符";	
		return false;
	}
	if(reg.test(uname)) {
		document.getElementById("spuname").innerHTML = "";	
		
	}
	
	

	xmlhttp = new XMLHttpRequest();
	
	xmlhttp.onreadystatechange = resp;
	
	var a = "ajregist";
	
	xmlhttp.open("get", "<%=request.getContextPath()%>/QianLoginServlet?name=" + uname + "&method=" + a,true);
	
	xmlhttp.send(null);
	
	 return true;
}

function resp() {
	
	if (xmlhttp.readyState == 4) {
		if (xmlhttp.status == 200) {
			var txt = xmlhttp.responseText;
			if (txt == 0) {
				document.getElementById("spuname").innerHTML = "可用";
			} else {
				document.getElementById("spuname").innerHTML = "用户名已存在！";
				
			}
		}
	}
}




</script>


</head>

<body>
	<iframe style="width:100%;height:236px" scrolling="no" frameborder="0"
		src="qiantai/header.jsp"></iframe>

	<div class="content">

		<div class="clear"></div>
		<div class="buyDiv">

			<div class="buyHeader">
				<h1>注册</h1>
				<form action="<%=request.getContextPath() %>/QianLoginServlet?method=regist" method="post" onsubmit="return ckall()">
					<div class="innerDiv" onclick="history.back();">返回</div>
					<div class="innerDiv" >
						<input type="submit" value="注册"
							style=" border: none; background: none; 
         color: white; line-height:24px;cursor:pointer;" />
					</div>
			</div>

			<div class="buyBody">
				<fieldset class="registField">
					<legend style="color:#DE3237;" align="left">注册</legend>

					<table class="registTable">
						<tr>
							<td align="right" style="width:30%;">用户名</td>
							<td></td>
							<td align="left"><input type="text" id="uname" name="uname" onblur="ckuname()" />
							<span id="spuname"></span></td>
						</tr>
						<tr>
							<td align="right">密码</td>
							<td></td>
							<td align="left"><input type="password" id="pwd"
								name="pwd" onblur="ckpwd()"/><span id="sppwd"></span></td>
						</tr>
						<tr>
							<td align="right">真实姓名</td>
							<td></td>
							<td align="left"><input type="text" id="rname" name="rname" onblur="ckrname()"/><span
								id="sprname"></span></td>
						</tr>
						<tr>
							<td align="right">身份证</td>
							<td></td>
							<td align="left"><input type="text" id="uid" name="uid" onblur="ckuid()"/><span
								id="spuid"></span></td>
						</tr>
						<tr>
							<td align="right">性别</td>
							<td></td>
							<td align="left"><input type="radio" name="gender" id="man" value="男" checked="checked"
								 />男 <input type="radio" name="gender" id="woman" value="女"/>女</td>
						</tr>
						<tr>
							<td align="right">联系电话</td>
							<td></td>
							<td align="left"><input type="text" id="phone" name="phone" onblur="ckphone()"/><span
								id="spphone"></span></td>
						</tr>
						<tr>
							<td align="right">地址</td>
							<td></td>
							<td align="left"><input type="text" id="address"
								name="address" onblur="ckaddress()"/><span id="spaddress"></span></td>
						</tr>
						<tr>
							<td align="right">邮箱</td>
							<td></td>
							<td align="left"><input type="text" id="email" name="email" onblur="ckemail()"/><span
								id="spemail"></span></td>
						</tr>
						<tr>
							<td align="right">学校</td>
							<td></td>
							<td align="left"><input type="text" id="school" name="school" /></td>
						</tr>
						<tr>
							<td align="right">专业</td>
							<td></td>
							<td align="left"><input type="text" id="major" name="major"/></td>
						</tr>
						<tr>
							<td align="right">备注</td>
							<td></td>
							<td align="left"><textarea cols="30" rows="4"
									style="resize:none;" id="remark" name="remark">
                    </textarea></td>
						</tr>
					</table>
					</form>
				</fieldset>
			</div>
		</div>
		<div class="clear"></div>
		<!--清除浮动-->
	</div>
	<!--content end-->



	<div class="footer">
		<ul>


			<li class="li_left">地址：北京海淀区成府路**号</li>
			<li class="li_right">联系电话：010-82365636</li>
		</ul>
	</div>
	<!--footer end-->
	<div style="display:none">
		<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540'
			language='JavaScript' charset='gb2312'></script>
	</div>
</body>
</html>